home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol A-4
/
(Vol A-4) Vol. A4.iso
/
Games
/
maquiagem-lana.swf
/
scripts
/
frame_4
/
DoAction.as
Wrap
Text File
|
2007-11-28
|
18KB
|
597 lines
stop();
var selected_tool = "foundation";
var current_foundation = 2;
var current_pencil = 0;
var current_eye_shadow1 = 2;
var current_eye_shadow2 = 2;
var current_blusher = 2;
var current_lip_stick = 2;
var current_lip_gloss = 2;
var current_mascara = 1;
var current_eyelash_curler = 1;
var current_eraser = 0;
var a_makeup_tool = ["foundation","pencil","eye_shadow1","eye_shadow2","blusher","lip_stick","lip_gloss","mascara","eyelash_curler"];
var i = 0;
while(i < a_makeup_tool.length)
{
_root[a_makeup_tool[i]].onRelease = function()
{
so1.start(0,1);
this.gotoAndStop(1);
selected_tool = this._name;
if(makeup_box_moving._currentframe == 1 || makeup_box_moving._currentframe == 12)
{
makeup_box_down();
}
else
{
makeup_box_moving.gotoAndPlay(8);
}
};
_root[a_makeup_tool[i]].onRollOver = function()
{
so1.start(0,1);
this.gotoAndPlay(2);
};
_root[a_makeup_tool[i]].onRollOut = function()
{
this.gotoAndStop(1);
};
_root[a_makeup_tool[i]].onReleaseOutside = function()
{
this.gotoAndStop(1);
selected_tool = this._name;
if(makeup_box_moving._currentframe == 1 || makeup_box_moving._currentframe == 12)
{
makeup_box_down();
}
else
{
makeup_box_moving.gotoAndPlay(8);
}
};
_root[a_makeup_tool[i]].onRollOver = function()
{
so1.start(0,1);
this.gotoAndPlay(2);
};
_root[a_makeup_tool[i]].onRollOut = function()
{
this.gotoAndStop(1);
};
i++;
}
makeup_clear_bt.onRollOver = function()
{
so1.start(0,1);
this.makeup_clear_bt_rollover.gotoAndStop(2);
};
makeup_clear_bt.onRollOut = function()
{
this.makeup_clear_bt_rollover.gotoAndStop(1);
};
makeup_clear_bt.onPress = function()
{
this.gotoAndStop(2);
selected_tool = "eraser";
};
makeup_clear_bt.onRelease = function()
{
so1.start(0,1);
this.gotoAndStop(1);
selected_tool = "eraser";
if(makeup_box_moving._currentframe == 1 || makeup_box_moving._currentframe == 12)
{
makeup_box_down();
}
else
{
makeup_box_moving.gotoAndPlay(8);
}
};
makeup_clear_bt.onReleaseOutside = function()
{
this.gotoAndStop(1);
selected_tool = "eraser";
if(makeup_box_moving._currentframe == 1 || makeup_box_moving._currentframe == 12)
{
makeup_box_down();
}
else
{
makeup_box_moving.gotoAndPlay(8);
}
};
makeup_box_down = function()
{
if(selected_tool == "foundation")
{
makeup_tool_m.gotoAndStop(1);
makeup_box_moving.makeup_box.gotoAndStop(1);
makeup_box_moving.makeup_box.makeup_color.gotoAndStop(4);
makeup_box_moving.gotoAndPlay(2);
current_foundation = 2;
}
else if(selected_tool == "pencil")
{
makeup_tool_m.gotoAndStop(2);
makeup_box_moving.makeup_box.gotoAndStop(3);
makeup_box_moving.gotoAndPlay(2);
make_eyebrow_move();
}
else if(selected_tool == "eye_shadow1")
{
makeup_tool_m.gotoAndStop(3);
makeup_box_moving.makeup_box.gotoAndStop(1);
makeup_box_moving.makeup_box.makeup_color.gotoAndStop(2);
makeup_box_moving.gotoAndPlay(2);
current_eye_shadow1 = 2;
}
else if(selected_tool == "eye_shadow2")
{
makeup_tool_m.gotoAndStop(4);
makeup_box_moving.makeup_box.gotoAndStop(1);
makeup_box_moving.makeup_box.makeup_color.gotoAndStop(2);
makeup_box_moving.gotoAndPlay(2);
current_eye_shadow2 = 2;
}
else if(selected_tool == "blusher")
{
makeup_tool_m.gotoAndStop(5);
makeup_box_moving.makeup_box.gotoAndStop(2);
makeup_box_moving.gotoAndPlay(2);
current_blusher = 2;
}
else if(selected_tool == "lip_stick")
{
makeup_tool_m.gotoAndStop(6);
makeup_box_moving.makeup_box.gotoAndStop(1);
makeup_box_moving.makeup_box.makeup_color.gotoAndStop(1);
makeup_box_moving.gotoAndPlay(2);
current_lip_stick = 2;
}
else if(selected_tool == "lip_gloss")
{
makeup_tool_m.gotoAndStop(7);
makeup_box_moving.makeup_box.gotoAndStop(1);
makeup_box_moving.makeup_box.makeup_color.gotoAndStop(3);
makeup_box_moving.gotoAndPlay(2);
current_lip_gloss = 2;
}
else if(selected_tool == "mascara")
{
makeup_tool_m.gotoAndStop(8);
eyelash_curler;
}
else if(selected_tool == "eyelash_curler")
{
makeup_tool_m.gotoAndStop(9);
}
else if(selected_tool == "eraser")
{
makeup_tool_m.gotoAndStop(10);
makeup_box_moving.makeup_box.gotoAndStop(4);
makeup_box_moving.gotoAndPlay(2);
}
make_pick_color();
};
makeup_tool_m.onEnterFrame = function()
{
if(tool_hidden_area0.hitTest(_xmouse,_ymouse) || tool_hidden_area1.hitTest(_xmouse,_ymouse) || tool_hidden_area2.hitTest(_xmouse,_ymouse))
{
Mouse.show();
this._visible = false;
}
else
{
Mouse.hide();
this._visible = true;
}
if(makeup_box_moving.hitTest(_xmouse,_ymouse))
{
if(selected_tool != "foundation" && selected_tool != "mascara" && selected_tool != "eyelash_curler")
{
this._yscale = -100;
}
if(selected_tool == "pencil" || selected_tool == "eraser")
{
Mouse.show();
this._visible = false;
}
}
else
{
this._yscale = 100;
}
this._x = _root._xmouse;
this._y = _root._ymouse;
};
_root.onMouseDown = function()
{
if(makeup_tool_m._visible)
{
if(!makeup_box_moving.hitTest(_xmouse,_ymouse))
{
so2.start(0,1);
makeup_tool_m.mov.gotoAndPlay(2);
}
if(makeup_box_moving.hitTest(_xmouse,_ymouse) && (makeup_box_moving._currentframe == 1 || makeup_box_moving._currentframe == 12))
{
so2.start(0,1);
}
if(selected_tool == "mascara" || selected_tool == "eyelash_curler")
{
makeup_tool_m.mov.gotoAndPlay(2);
}
}
if(ava_face.makeup_area.hitTest(_root._xmouse,_ymouse))
{
if(selected_tool == "pencil")
{
if(ava_face.face_eyebrow._currentframe != current_eyebrow + 1)
{
ava_face.face_eyebrow.gotoAndStop(current_eyebrow + 1);
ava_face.face_eyebrow._alpha = 0;
}
ava_face.face_eyebrow._alpha += 20;
if(Math.round(ava_face.face_eyebrow._alpha) > 100)
{
ava_face.face_eyebrow._alpha = 100;
}
}
if(selected_tool == "foundation")
{
if(ava_face.face_foundation._currentframe != current_foundation)
{
ava_face.face_foundation.gotoAndStop(current_foundation);
ava_face.face_foundation._alpha = 0;
}
ava_face.face_foundation._alpha += 20;
if(Math.round(ava_face.face_foundation._alpha) > 100)
{
ava_face.face_foundation._alpha = 100;
}
}
if(selected_tool == "eye_shadow1")
{
if(ava_face.face_eye_shadow1._currentframe != current_eye_shadow1)
{
ava_face.face_eye_shadow1.gotoAndStop(current_eye_shadow1);
ava_face.face_eye_shadow1._alpha = 0;
}
ava_face.face_eye_shadow1._alpha += 20;
if(Math.round(ava_face.face_eye_shadow1._alpha) > 100)
{
ava_face.face_eye_shadow1._alpha = 100;
}
}
if(selected_tool == "eye_shadow2")
{
if(ava_face.face_eye_shadow2._currentframe != current_eye_shadow2)
{
ava_face.face_eye_shadow2.gotoAndStop(current_eye_shadow2);
ava_face.face_eye_shadow2._alpha = 0;
}
ava_face.face_eye_shadow2._alpha += 20;
if(Math.round(ava_face.face_eye_shadow2._alpha) > 100)
{
ava_face.face_eye_shadow2._alpha = 100;
}
}
if(selected_tool == "blusher")
{
if(ava_face.face_cheek._currentframe != current_blusher)
{
ava_face.face_cheek.gotoAndStop(current_blusher);
ava_face.face_cheek._alpha = 0;
}
ava_face.face_cheek._alpha += 20;
if(Math.round(ava_face.face_cheek._alpha) > 100)
{
ava_face.face_cheek._alpha = 100;
}
}
if(selected_tool == "lip_stick")
{
ava_face.face_lip_gloss.gotoAndStop(1);
if(ava_face.face_lip._currentframe != current_lip_stick)
{
ava_face.face_lip.gotoAndStop(current_lip_stick);
ava_face.face_lip._alpha = 0;
}
ava_face.face_lip._alpha += 20;
if(Math.round(ava_face.face_lip._alpha) > 100)
{
ava_face.face_lip._alpha = 100;
}
}
if(selected_tool == "lip_gloss")
{
ava_face.face_lip.gotoAndStop(1);
if(ava_face.face_lip_gloss._currentframe != current_lip_gloss)
{
ava_face.face_lip_gloss.gotoAndStop(current_lip_gloss);
ava_face.face_lip_gloss._alpha = 0;
}
ava_face.face_lip_gloss._alpha += 20;
if(Math.round(ava_face.face_lip_gloss._alpha) > 100)
{
ava_face.face_lip_gloss._alpha = 100;
}
}
if(selected_tool == "mascara")
{
if(current_mascara < 6)
{
current_mascara++;
}
ava_face.face_curled_eyelashes.gotoAndStop(1);
ava_face.face_eyelashes.gotoAndStop(current_mascara);
current_eyelash_curler = 1;
}
if(selected_tool == "eyelash_curler")
{
ava_face.face_eyelashes.gotoAndStop(1);
ava_face.face_curled_eyelashes.gotoAndStop(current_mascara);
}
if(selected_tool == "eraser")
{
if(current_eraser == 2)
{
ava_face.face_foundation._alpha -= 20;
if(ava_face.face_foundation._alpha < 0)
{
ava_face.face_foundation._alpha = 0;
}
}
else if(current_eraser == 3)
{
if(ava_face.face_curled_eyelashes._currentframe != 1)
{
ava_face.face_eyelashes.gotoAndStop(ava_face.face_curled_eyelashes._currentframe);
ava_face.face_curled_eyelashes.gotoAndStop(1);
}
ava_face.face_eyelashes.prevFrame();
current_mascara = ava_face.face_eyelashes._currentframe;
}
else if(current_eraser == 4)
{
ava_face.face_eye_shadow2._alpha -= 20;
if(Math.round(ava_face.face_eye_shadow2._alpha) < 0)
{
ava_face.face_eye_shadow2._alpha = 0;
}
}
else if(current_eraser == 5)
{
ava_face.face_eye_shadow1._alpha -= 20;
if(Math.round(ava_face.face_eye_shadow1._alpha) < 0)
{
ava_face.face_eye_shadow1._alpha = 0;
}
}
else if(current_eraser == 6)
{
ava_face.face_cheek._alpha -= 20;
if(Math.round(ava_face.face_cheek._alpha) < 0)
{
ava_face.face_cheek._alpha = 0;
}
}
else if(current_eraser == 7)
{
if(ava_face.face_lip._currentframe != 1)
{
ava_face.face_lip._alpha -= 20;
if(Math.round(ava_face.face_lip._alpha) < 0)
{
ava_face.face_lip._alpha = 0;
}
}
if(ava_face.face_lip_gloss._currentframe != 1)
{
ava_face.face_lip_gloss._alpha -= 20;
if(Math.round(ava_face.face_lip_gloss._alpha) < 0)
{
ava_face.face_lip_gloss._alpha = 0;
}
}
}
}
}
};
make_pick_color = function()
{
var _loc3_ = 0;
while(_loc3_ < 6)
{
makeup_box_moving.makeup_box["makeup_box_select_area" + _loc3_].onPress = function()
{
if(makeup_box_moving._currentframe != 1 && makeup_box_moving._currentframe != 12)
{
so1.start(0,1);
}
_root["current_" + selected_tool] = parseInt(this._name.slice(22,23)) + 2;
if(selected_tool == "foundation")
{
_root.makeup_tool_m.mov.chage_color.gotoAndStop(parseInt(this._name.slice(22,23)) + 1);
}
else
{
_root.makeup_tool_m.mov[selected_tool].change_color.gotoAndStop(parseInt(this._name.slice(22,23)) + 1);
}
};
_loc3_ = _loc3_ + 1;
}
};
var current_eyebrow = 0;
make_eyebrow_move = function()
{
current_eyebrow = 0;
var eye_move = false;
eye = makeup_box_moving.makeup_box.eyebrow_m;
var _loc2_ = 0;
while(_loc2_ < 6)
{
eye.eyebrow_win["eyebrow_" + _loc2_].removeMovieClip();
_loc2_ = _loc2_ + 1;
}
eye.eyebrow_win.setMask(eye.eyebrow_mask_m);
eye.eyebrow_win.attachMovie("eyebrow_0","eyebrow_0",0);
eye.eyebrow_m_rbt.onRollOver = function()
{
so1.start(0,1);
this._xscale = 110;
this._yscale = 110;
};
eye.eyebrow_m_rbt.onRollOut = function()
{
this._xscale = 100;
this._yscale = 100;
};
eye.eyebrow_m_rbt.onPress = function()
{
if(!eye_move)
{
so1.start(0,1);
this.gotoAndStop(2);
eye.eyebrow_win["eyebrow_" + current_eyebrow].onEnterFrame = function()
{
this._x += 12;
if(this._x > this._width)
{
this.removeMovieClip();
delete this.onEnterFrame;
}
};
current_eyebrow++;
if(current_eyebrow > 5)
{
current_eyebrow = 0;
}
eye.eyebrow_win.attachMovie("eyebrow_" + current_eyebrow,"eyebrow_" + current_eyebrow,current_eyebrow);
eye.eyebrow_win["eyebrow_" + current_eyebrow]._x = - eye.eyebrow_win["eyebrow_" + current_eyebrow]._width - 30;
eye.eyebrow_win["eyebrow_" + current_eyebrow].onEnterFrame = function()
{
eye_move = true;
this._x += 12;
if(this._x > 0)
{
this._x = 0;
eye_move = false;
delete this.onEnterFrame;
}
};
}
};
eye.eyebrow_m_rbt.onRelease = function()
{
this.gotoAndStop(1);
};
eye.eyebrow_m_rbt.onReleaseOutside = function()
{
this.gotoAndStop(1);
};
eye.eyebrow_m_lbt.onRollOver = function()
{
so1.start(0,1);
this._xscale = 110;
this._yscale = 110;
};
eye.eyebrow_m_lbt.onRollOut = function()
{
this._xscale = 100;
this._yscale = 100;
};
eye.eyebrow_m_lbt.onPress = function()
{
if(!eye_move)
{
so1.start(0,1);
this.gotoAndStop(2);
eye.eyebrow_win["eyebrow_" + current_eyebrow].onEnterFrame = function()
{
this._x -= 12;
if(this._x < - this._width)
{
this.removeMovieClip();
delete this.onEnterFrame;
}
};
current_eyebrow--;
if(current_eyebrow == -1)
{
current_eyebrow = 5;
}
eye.eyebrow_win.attachMovie("eyebrow_" + current_eyebrow,"eyebrow_" + current_eyebrow,current_eyebrow);
eye.eyebrow_win["eyebrow_" + current_eyebrow]._x = eye.eyebrow_win["eyebrow_" + current_eyebrow]._width + 30;
eye.eyebrow_win["eyebrow_" + current_eyebrow].onEnterFrame = function()
{
eye_move = true;
this._x -= 12;
if(this._x < 0)
{
this._x = 0;
eye_move = false;
delete this.onEnterFrame;
}
};
}
};
eye.eyebrow_m_lbt.onRelease = function()
{
this.gotoAndStop(1);
};
eye.eyebrow_m_lbt.onReleaseOutside = function()
{
this.gotoAndStop(1);
};
};
ending_go_bt.onRollOver = function()
{
so1.start(0,1);
this.ending_go_bt_rollover.gotoAndStop(2);
};
ending_go_bt.onRollOut = function()
{
this.ending_go_bt_rollover.gotoAndStop(1);
};
ending_go_bt.onPress = function()
{
this.gotoAndStop(2);
};
ending_go_bt.onRelease = function()
{
so1.start(0,1);
this.gotoAndStop(1);
save_face();
_root.gotoAndStop(5);
};
ending_go_bt.onReleaseOutside = function()
{
this.gotoAndStop(1);
};
save_face = function()
{
current_foundation_my_alpha = ava_face.face_foundation._alpha;
current_pencil_my_alpha = ava_face.face_eyebrow._alpha;
current_eye_shadow1_my_alpha = ava_face.face_eye_shadow1._alpha;
current_eye_shadow2_my_alpha = ava_face.face_eye_shadow2._alpha;
current_blusher_my_alpha = ava_face.face_cheek._alpha;
current_lip_stick_my_alpha = ava_face.face_lip._alpha;
current_lip_gloss_my_alpha = ava_face.face_lip_gloss._alpha;
current_foundation = ava_face.face_foundation._currentframe;
current_pencil = ava_face.face_eyebrow._currentframe;
current_eye_shadow1 = ava_face.face_eye_shadow1._currentframe;
current_eye_shadow2 = ava_face.face_eye_shadow2._currentframe;
current_blusher = ava_face.face_cheek._currentframe;
current_lip_stick = ava_face.face_lip._currentframe;
current_lip_gloss = ava_face.face_lip_gloss._currentframe;
current_mascara = ava_face.face_eyelashes._currentframe;
current_eyelash_curler = ava_face.face_curled_eyelashes._currentframe;
};
makeup_box_moving.gotoAndStop(7);
makeup_box_moving.makeup_box.gotoAndStop(1);
makeup_box_moving.makeup_box.makeup_color.gotoAndStop(4);
make_pick_color();